<!--
 * @Author: jswang
 * @Date: 2021-08-03 11:06:42
 * @LastEditTime: 2021-08-03 11:31:18
-->
<template>
  <el-card class="page-tools">
   <el-row type="flex" justify="space-between" align="middle">
     <!-- 前插槽 -->
     <el-col>
       <!-- 具名插槽  匿名插槽 -->
      <div v-if="showBefore" class="before">
          <!-- 图标 随着 showBefore显示而显示 -->
          <i class="el-icon-info" />
          <slot name="before" />
        </div>
     </el-col>
     <!-- 前插槽 -->
     <el-col :span="6">
       <el-row type="flex" justif="end">
         <!-- 后置插槽 -->
         <slot name="after"/>
       </el-row>
     </el-col>
   </el-row>
  </el-card>
</template>
<script>
export default {
  props: {
    showBefore: {
      default: false,
      type: Boolean
    }
  }
}
</script>

<style lang='scss'>
 .page-tools {
    margin: 10px 0;
    .before {
      line-height: 34px;
    i {
      margin-right: 5px;
      color: #409eff;
    }
    display: inline-block;
    padding: 0px 10px;
    border-radius: 3px;
    border: 1px solid rgba(145, 213, 255, 1);
    background: rgba(230, 247, 255, 1);
  }
 }
</style>